package only.my.railgunys.shooting;

import only.my.railgunys.artifact.ArtifactSuitEffect;
import only.my.railgunys.artifact.imp.ArchaicPetra;
import only.my.railgunys.artifact.imp.Gladiator;
import only.my.railgunys.artifact.imp.RetracingBolide;
import only.my.railgunys.bean.Character;
import only.my.railgunys.bean.Weapon;
import only.my.railgunys.utils.Crutch;
import only.my.railgunys.weapon.SerpentSpine;
import only.my.railgunys.weapon.Unforged;
import only.my.railgunys.weapon.Whiteblind;
import only.my.railgunys.weapon.WolfsGravestone;
import org.springframework.stereotype.Component;

import static only.my.railgunys.preparation.SingleData.getSceneList;

@Component
public class Noelle extends RoleScene{
    @Override
    Character specialIncrease(Character character) {
        double defense = character.getDefense() + character.getDefense_ex();
        character.setAtk_ex(character.getAtk_ex()+defense*1.35);
        return character;
    }

    @Override
    public void calcWeaponData() {
        Weapon ss = new SerpentSpine(5);
        calcArtifactSuit(ss);
        Weapon wb = new Whiteblind(5);
        calcArtifactSuit(wb);
        Weapon unforged = new Unforged(1,1);
        calcArtifactSuit(unforged);
        Weapon unforged3 = new Unforged(1,3);
        calcArtifactSuit(unforged3);
        Weapon unforged5 = new Unforged(1,5);
        calcArtifactSuit(unforged5);
        WolfsGravestone wg = new WolfsGravestone(1);
        calcArtifactSuit(wg);
        wg.setSpecialEffect(true);
        calcArtifactSuit(wg);
    }

    @Override
    protected void calcArtifactSuit(Weapon weapon) {
        ArtifactSuitEffect retracingBolide = new RetracingBolide();
        ArtifactSuitEffect ap = new ArchaicPetra();
        ArtifactSuitEffect gladiator = new Gladiator();

        sceneRepository.saveAll(getSceneList(calcSuit4Sp(weapon, retracingBolide)));
        sceneRepository.saveAll(getSceneList(calcSuit4Sp(weapon, gladiator)));
        sceneRepository.saveAll(getSceneList(calcSuit22Sp(weapon, ap, gladiator)));
    }

    @Override
    public void addTeam(Character character) {
        Crutch.doubleGeoTeam(character);
        Crutch.ningguang(character);
//        Crutch.tm(character);
    }

    @Override
    public Character initRoleBaseInfo() {
        Character noelle = new Character();
        noelle.setHp(12071.0);
        noelle.setAtk(191.0);
        noelle.setDefense(799.0);
        noelle.setRole(9);
        noelle.setCritDmg(50D);
        noelle.setCritRate(5D);
        noelle.setLevel(90);
        noelle.setDescription("90诺艾尔");
        noelle.addDefense(30.0); //突破+30%防御
        noelle.setSkillDmg(1.56); // 10级A第一刀
        noelle.setAtkUseful(true);
        noelle.setDefenseUseful(true);
        noelle.setCritRateUseful(true);
        noelle.setElementDmgUseful(true);
        return noelle;
    }
}
